﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AspNetCore.Http;

namespace FrameWork.Extensions
{
   public static class HttpRequestExtensions
   {
       public static string GetAbsoluteUri(this HttpRequest request)
       {
            return new StringBuilder()
                .Append(request.Scheme)
                .Append("://")
                .Append(request.Host)
                .Append(request.PathBase)
                .Append(request.Path)
                .Append(request.QueryString)
                .ToString();
        }
       public static string GetAbsoluteUri(this HttpContext httpContext)
       {
            return httpContext.Request.GetAbsoluteUri();
        }
    }
}
